package com.minio.template;

import com.minio.property.MinioConfigurationProperties;
import io.minio.MinioClient;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;

/**
 * @ClassName: MonioAccecor
 * @Description: minio访问器
 * @Author: xuweiLi
 * @Create: 2025/7/4 20:28
 **/
public class MinioAccessor implements InitializingBean {

    protected final Log logger = LogFactory.getLog(MinioAccessor.class);

    private MinioConfigurationProperties properties;

    private MinioClient minioClient;

    @Override
    public void afterPropertiesSet() throws Exception {
        Assert.state(getMinioClient() != null, "RedisConnectionFactory is required");
        logger.info("Setting up Minio Client");
    }

    public MinioClient getMinioClient() {
        return minioClient;
    }

    public void setMinioClient(MinioClient minioClient) {
        this.minioClient = minioClient;
    }

    public MinioConfigurationProperties getProperties() {
        return properties;
    }

    public void setProperties(MinioConfigurationProperties properties) {
        this.properties = properties;
    }
}